package com.tang.algorithm.array;

import java.util.Arrays;
import java.util.HashMap;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/6/7 15:10
 */
public class LeetCode1464 {
    public static void main(String[] args) {
        int[] a= {1,5,4,5};
        System.out.println(maxProduct(a));
    }
    public static int maxProduct(int[] nums) {

        int size = nums.length;
        Arrays.sort(nums);
        return (nums[size-1]-1)*(nums[size-2]-1);
    }
}
